//
// Created by Scave on 2024/9/26.
//

#ifndef TIEC_MACRO_H
#define TIEC_MACRO_H
#include <string>

#define NS_TIEC tiec

#ifdef ENABLE_LOG

#define LOG_TAG "TIEC"

#ifdef ANDROID
#include "platform/android/android_log.h"
#else
#include "log.h"
#define LOGI(fmt, ...) LogInfo(fmt, __VA_ARGS__);
#define LOGD(fmt, ...) LogDebug(fmt, __VA_ARGS__);
#define LOGW(fmt, ...) LogWarn(fmt, __VA_ARGS__);
#define LOGE(fmt, ...) LogError(fmt, __VA_ARGS__);
#endif

#else

#define LOGI(fmt, ...)
#define LOGD(fmt, ...)
#define LOGW(fmt, ...)
#define LOGE(fmt, ...)

#endif

#define SAFE_DELETE_PTR(ptr) \
if (ptr != nullptr) {        \
  delete ptr;                \
}

#include <memory>
#include <mutex>
#include <functional>
#define PTR std::shared_ptr
#define MAKE_PTR std::make_shared
#define WEAK_PTR std::weak_ptr
#define MUTEX std::mutex
#define LOCK_GUARD(mtx) std::lock_guard<MUTEX> __lock(mtx);
#define FUNCTION(sig) std::function<sig>
#define VOID_FUNCTION(...) std::function<void(__VA_ARGS__)>
#define PAIR std::pair

using String = std::string;
using WString = std::wstring;
using Int64 = long long;
using Int32 = long;
#ifdef MACOS
#include <MacTypes.h>
#else
using UInt64 = unsigned long long;
using UInt32 = unsigned long;
#endif

#endif //TIEC_MACRO_H
